#pragma once
#include "driver/gpio.h"

namespace pwm_helper
{
    /**
    * period= 1000us -> freq= 1kHz 
    * period= 50us   -> freq=20kHz
    * period>=20us
    */
    void set_period(int period=1000);

    /**
     * D1<=pin_num<=D8(待确定)
     * 0<=duty<=1
     */
    int add_pwm(gpio_num_t pin_num, float duty);

    void start_pwm_init_task();
} // namespace pwm_helper
